# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=libnitrokey
pkgver=3.8
pkgrel=1
arch="all"
url="https://nitrokey.com/"
pkgdesc="Communicate with Nitrokey devices in a clean and easy manner"
license="LGPL-3.0-or-later"
depends="nitrokey-udev-rules"
makedepends="
	cmake
	hidapi-dev
	"
source="https://github.com/Nitrokey/libnitrokey/archive/v$pkgver/libnitrokey-v$pkgver.tar.gz"
subpackages="$pkgname-dev"
options="!check" # No tests

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build

	# The udev rules are shipping in the nitrokey-udev-rules dependency
	rm -r "$pkgdir"/usr/lib/udev/rules.d
}

sha512sums="
30f966eed77aa75057b096d18f8e88d6be28a376dfc1888e44aff80347e031a16755d30acf1bca196acc5b922778d90627ac71cba22f5cb002ba3ec058939c90  libnitrokey-v3.8.tar.gz
"
